/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controller;

import core.Node;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import model.codebehind.CodeModel;
import model.graphic.GraphicModel;
import model.graphic.objects.Graphical;
import model.graphic.objects.RectangleGraphical;

/**
 *
 * @author Jelle
 */
public class State implements Serializable {

    private ArrayList<Graphical> Gobjects = new ArrayList<Graphical>();
    private ArrayList<Graphical> Gselection = new ArrayList<Graphical>();
    private HashMap<String, RectangleGraphical> Glink = new HashMap<String, RectangleGraphical>();

    private ArrayList<Node> Cobjects = new ArrayList<Node>();
    private HashMap<String, Node> Clink = new HashMap<String, Node>();

    public State(GraphicModel gmodel, CodeModel cmodel) {
        this.Gobjects = (ArrayList<Graphical>)gmodel.getObjects().clone();
        this.Gselection = (ArrayList<Graphical>)gmodel.getSelection().clone();
        this.Glink = (HashMap<String, RectangleGraphical>)gmodel.getLink().clone();
        this.Cobjects = (ArrayList<Node>)cmodel.getObjects().clone();
        this.Clink = (HashMap<String, Node>)cmodel.getLink().clone();
    }

    public State(){}

    /**
     * @return the Gobjects
     */
    public ArrayList<Graphical> getGobjects() {
        return Gobjects;
    }

    /**
     * @param Gobjects the Gobjects to set
     */
    public void setGobjects(ArrayList<Graphical> Gobjects) {
        this.Gobjects = Gobjects;
    }

    /**
     * @return the Gselection
     */
    public ArrayList<Graphical> getGselection() {
        return Gselection;
    }

    /**
     * @param Gselection the Gselection to set
     */
    public void setGselection(ArrayList<Graphical> Gselection) {
        this.Gselection = Gselection;
    }

    /**
     * @return the Glink
     */
    public HashMap<String, RectangleGraphical> getGlink() {
        return Glink;
    }

    /**
     * @param Glink the Glink to set
     */
    public void setGlink(HashMap<String, RectangleGraphical> Glink) {
        this.Glink = Glink;
    }

    /**
     * @return the Cobjects
     */
    public ArrayList<Node> getCobjects() {
        return Cobjects;
    }

    /**
     * @param Cobjects the Cobjects to set
     */
    public void setCobjects(ArrayList<Node> Cobjects) {
        this.Cobjects = Cobjects;
    }

    /**
     * @return the Clink
     */
    public HashMap<String, Node> getClink() {
        return Clink;
    }

    /**
     * @param Clink the Clink to set
     */
    public void setClink(HashMap<String, Node> Clink) {
        this.Clink = Clink;
    }

}
